Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports SSvote refactor + new vote UI from TG #2667

Merged
merged 16 commits into from
Feb 15, 2024

Conversation

MarkSuckerberg
Copy link
Member

About The Pull Request

See title, might possibly lead to more interesting things, might just be something nice to have. Maybe both.

Why It's Good For The Game

The voting subsystem was old and flawed, and this gives it a new coat of paint

Changelog

🆑 MrMelbert, san7890, lessthnthree, ZephyrTFA, MarkSuckerberg
admin: You can now create a custom approval-type vote
admin: You can now manually start a transfer vote in the vote menu
config: Removes the player mode voting setting as we don't use modes
/:cl:

MrMelbert and others added 6 commits January 23, 2024 15:46
…ipt (#66772)

Makes vote into their own singleton datums.
Refactors the voting subsystem to accommodate.
Refactors the vote UI from JS to TSX (probably badly).
* Fixes some minor formatting issues with vote

* Wrong thing.

* Actually I think this is supposed to be here
* Verbose Vote Initiation Feedback Tooltippery

Hey there,

So basically, the old implementation had it such that when a vote was disabled and you tried to trigger it, you could get a very nice message in your chat explaining why you could not trigger that vote in that moment. HOWEVER, there's a current fatal flaw in this logic:

You can't ever get that to_chat reason as to _why_ this vote is disabled since you can't click the button. I don't know if this ever worked, which is sad, because we had a lot of these nice messages that one would never see. So, let's leverage the power of TGUI and add messages.

The messages are applied per-datum singleton, and are a generic explanation of what the vote does when there is no specific reason assigned to it when the can_be_initiated() proc runs. If it can not be initiated, we change the message to reflect exactly why the player can not initiate the vote. It ends up looking something like this:

In order for this to work well for the restart vote and to lessen the amount of copy-pasting I might have to do, I created a new proc that checks to see if a valid admin is online, and uses that for both updating the message and restarting the server if the vote clears.

* fixes messages not resetting

* removes misleading section

the admin can always restart the server if they wish
Fixes runtime from voting actions due to calling remove on ownerless actions
Approval Voting is a system in which voters can select as many maps as
they want, instead of selecting only one. Final tallies show how many
votes each map received, and the winner is the map with the most
support.

- Custom votes can now be started using either system
- Icon during AV votes indicating your selections
- Map population filter counts active players and participating ghosts

https://user-images.githubusercontent.com/83487515/222580901-61506cc3-dc42-4435-9775-1e6291a3f734.mp4

First-past-the-post (our current voting system) has flaws such as
creating a bunch of wasted votes, in that a large number of selections
ultimately have no impact and for example, a map can win a 3 way race
11/10/10, even though 2/3 of the votes were not for that map. This leads
to people having to vote strategically, and perhaps not what their true
choice is.

Approval Voting solves this by instead allowing the player to select all
the maps they would like to play, so they can vote for their true
preferred choice, as well as alternates.

For example, a player that wants Metastation, is okay with Icebox, and
doesn't want Delta may feel pressured to vote Icebox if it's in a 2 way
race with Delta.

AV lets them vote for Meta, and Icebox or as many others as they want as
their alternates and creates a more fair outcome of a map vote.

Map population filter removing AFK/lobby screen dwellers gives a better
number of active players so as to not trip the map filter's population
cap earlier than it should.

tl;dr: Less of this

![image](https://user-images.githubusercontent.com/83487515/222860681-210f2d7e-2368-4d42-84d5-6de838995e50.png)

:cl: LT3
rscadd: Added new multi-vote system
balance: Map votes are now calculated using multi-vote instead of the
old single-vote system
admin: Admins can now use either multi-vote or single-vote for custom
votes
code: Map choice filtering uses active player count, not all connected
clients
/:cl:
@github-actions github-actions bot added Config Watch us shake head admins violently until this gets merged. DME Edit TGUI Code change Watch something violently break. labels Jan 25, 2024
@thgvr
Copy link
Member

thgvr commented Jan 25, 2024

Not so sure about weighted restart votes

@thgvr
Copy link
Member

thgvr commented Feb 4, 2024

Probably good to merge just angry linters

@MarkSuckerberg MarkSuckerberg added this pull request to the merge queue Feb 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Feb 11, 2024
@github-actions github-actions bot added the Merge Conflict Use Git Hooks, you're welcome. label Feb 11, 2024
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the Merge Conflict Use Git Hooks, you're welcome. label Feb 11, 2024
@thgvr thgvr added this pull request to the merge queue Feb 15, 2024
Merged via the queue into shiptest-ss13:master with commit 7af1f64 Feb 15, 2024
15 checks passed
MysticalFaceLesS pushed a commit to CeladonSS13/Shiptest that referenced this pull request Feb 16, 2024
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->
See title, might possibly lead to more interesting things, might just be
something nice to have. Maybe both.
The voting subsystem was old and flawed, and this gives it a new coat of
paint

:cl: MrMelbert, san7890, lessthnthree, ZephyrTFA, MarkSuckerberg
admin: You can now create a custom approval-type vote
admin: You can now manually start a transfer vote in the vote menu
config: Removes the player mode voting setting as we don't use modes
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Mark Suckerberg <[email protected]>
Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: san7890 <[email protected]>
Co-authored-by: lessthanthree <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code change Watch something violently break. Config Watch us shake head admins violently until this gets merged. DME Edit TGUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants